﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace  LINQToolKit.Douban.Entities
{
    public class Note : EntityBase
    {
        private const string PRIVACY_KEY = "privacy";
        private const string CANREPLY_KEY = "CanReply";

        public AssociationRef<People> Author { get; set; }

        public string Privacy 
        {
            get
            {
                return base.GetAttribute(PRIVACY_KEY);
            }
            set
            {
                base.SetAttribute(PRIVACY_KEY, value);
            }
        }

        public bool CanReply
        {
            get
            {
                var value = base.GetAttribute(CANREPLY_KEY);

                if (value != null)
                {
                    return Convert.ToBoolean(value);
                }

                return false;
            }
            set
            {
                base.SetAttribute(CANREPLY_KEY, value.ToString());
            }
        }
    }
}
